#!/usr/bin/env bash

echo "starting admin-express..."
eval "$(conda shell.bash hook)"
conda activate admin-express
echo "conda env activated"

cd $HOME/.works/admin-express || (echo 'admin-express path not found!' && exit)

PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH
export FLASK_ENV=default
export FLASK_DEBUG=False
export FLASK_APP=manage.py

# nohup gunicorn -c gunicorn_conf.py manage:app > logs/nohup_gunicorn.log 2>&1 &
nohup flask run -p 31009 -h 0.0.0.0 > logs/nohup_admin-express.log 2>&1 &
echo "admin-express started!"
